package cn.myjerry.others.pro;

import java.util.Properties;

/**
 * Properties => 资源配置文件的读写
 * key 与 value 只能为字符串
 * 存储与读取
 * 	setProperty(String key, String value)
 * 	getProperty(String key)
 * 	getProperty(String key, String defaultValue)
 * @author Jerry
 *
 */

public class Demo01 {
	public static void main(String[] args) {
		//创建对象
		Properties pro = new Properties();
		//存储
		pro.setProperty("driver", "oracle.jdbc.driver.OracleDriver");
		pro.setProperty("url", "jdbc:oracle:thin:@localhost:1521:orcl");
		pro.setProperty("user", "soctt");
		pro.setProperty("pwd", "tiger");
		//获取
		System.out.println(pro.getProperty("url", "test"));
	}
}
